//
//  DetailsViewController.m
//  GiftNote
//
//  Created by lanou3g on 15/8/11.
//  Copyright (c) 2015年 GN. All rights reserved.
//

#import "DetailsViewController.h"
#import "DetailsTableViewCell.h"
#import "DetailsHesder.h"

@interface DetailsViewController ()<UITableViewDataSource,UITableViewDelegate>
@property (nonatomic,retain) UITableView *MytableView;
@end

@implementation DetailsViewController




- (void)viewDidLoad {
    [super viewDidLoad];
   self.navigationItem.title = @"单品详情";
    self.navigationController.toolbarHidden = NO;
    self.navigationController.toolbar.barTintColor = [UIColor redColor];
    
    UIBarButtonItem *likeItem = [[UIBarButtonItem alloc] initWithTitle:@"喜欢" style:UIBarButtonItemStylePlain target:self action:@selector(likeItemAction:)];
    UIBarButtonItem *buyItem = [[UIBarButtonItem alloc] initWithTitle:@"去天猫购买" style:UIBarButtonItemStylePlain target:self action:@selector(buyItemAction:)];
    
    [self setToolbarItems:[NSArray arrayWithObjects:likeItem,buyItem, nil]];
    
    self.MytableView = [[UITableView alloc] initWithFrame:self.view.bounds style:UITableViewStylePlain];
    _MytableView.backgroundColor = [UIColor orangeColor];
    [_MytableView registerClass:[DetailsTableViewCell class] forCellReuseIdentifier:@"cell"];
    _MytableView.delegate = self;
    _MytableView.dataSource = self;
    [self.view addSubview:_MytableView];
    
}

- (void)likeItemAction:(UIBarButtonItem *)item{
    
    
}
- (void)buyItemAction:(UIBarButtonItem *)item{
    
    
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 10;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    DetailsTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell" forIndexPath:indexPath];
    return cell;
}

- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section{
    

    DetailsHesder *header = [[DetailsHesder alloc] init];
    
    return header;
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
